
#include <stdio.h>
#include <string.h>
#include "pico/stdlib.h"
#include "pico/binary_info.h"
#include "hardware/i2c.h"
#include "ms5351.h"

#define debug_level 1
#define _DRV_TAG_ "ClassE.c"

#define dbg(fmt, args...)                                                    \
    do                                                                       \
    {                                                                        \
        if (debug_level)                                                     \
        {                                                                    \
            printf("ClassE: " _DRV_TAG_ " %d " fmt " \n", __LINE__, ##args); \
        }                                                                    \
    } while (0)
#define info(fmt, args...)                                               \
    do                                                                   \
    {                                                                    \
        printf("ClassE: " _DRV_TAG_ " %d " fmt " \n", __LINE__, ##args); \
    } while (0)
#define err(fmt, args...)                                                       \
    do                                                                          \
    {                                                                           \
        printf("ClassE: error: " _DRV_TAG_ " %d " fmt " \n", __LINE__, ##args); \
    } while (0)

int main()
{
    stdio_init_all();
#if !defined(i2c_default) || !defined(PICO_DEFAULT_I2C_SDA_PIN) || !defined(PICO_DEFAULT_I2C_SCL_PIN)
#warning i2c/i2c example requires a board with I2C pins
    puts("Default I2C pins were not defined");
#else
    printf("Hello, ClassE! Reading raw data from registers...\n");

    gpio_init(PICO_DEFAULT_LED_PIN);
    gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
    gpio_put(PICO_DEFAULT_LED_PIN, 0);

    MS5351_IIC_Init();
    SofterCB_FreSet();

    printf("start ClassE init \r\n");

    while (1)
    {
    }
#endif
}
